package com.md.tww.service.Impl;

import com.md.tww.entity.Student;
import com.md.tww.mapper.StudentMapper;
import com.md.tww.service.StudentService;
import lombok.Data;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Data
@Service
public class StudentServiceImpl implements StudentService {

    @Autowired
    private StudentMapper studentMapper ;

    @Override
    public List<Student> selectAllStudent() {
        return studentMapper.selectAllStudent();
    }

    @Override
    public Student selectStudentById(int id) {
        return studentMapper.selectStudentById(id);
    }

    @Override
    public Boolean updateStudent(Student student) {
        return studentMapper.updateStudent(student) > 0;
    }

    @Override
    public Boolean insertStudent(Student student) {
        return studentMapper.insertStudent(student) > 0;
    }

    @Override
    public Boolean deleteStudent(int id) {
        return studentMapper.deleteStudent(id) > 0;
    }
}
